home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #14 / Monster Media No. 14 (April 1996) (Monster Media, Inc.).ISO / prog_bas / vbit140.zip / VBIT.BAS < prev    next >
BASIC Source File  |  1996-01-18  |  8KB  |  162 lines

  1. ' VBIT 1.40                         (c) 1996 InfoTech AS, Bergen, Norway
  2. ' ----------------------------------------------------------------------
  3. Declare Function AnsiToAscii$ Lib "VBIT.DLL" (ByVal strIn$)
  4. Declare Function AsciiToAnsi$ Lib "VBIT.DLL" (ByVal strIn$)
  5. Declare Function CRLF$ Lib "VBIT.DLL" (ByVal strIn$, ByVal ascii%)
  6. Declare Function Decrypt$ Lib "VBIT.DLL" (ByVal strIn$, ByVal cryptStr$)
  7. Declare Function Decrypt7$ Lib "VBIT.DLL" (ByVal strIn$, ByVal cryptStr$)
  8. Declare Function DecryptZ$ Lib "VBIT.DLL" (ByVal strIn$, ByVal cryptStr$)
  9. Declare Function Encrypt$ Lib "VBIT.DLL" (ByVal strIn$, ByVal cryptStr$)
  10. Declare Function Encrypt7$ Lib "VBIT.DLL" (ByVal strIn$, ByVal cryptStr$)
  11. Declare Function EncryptZ$ Lib "VBIT.DLL" (ByVal strIn$, ByVal cryptStr$)
  12. Declare Function FileExist% Lib "VBIT.DLL" (ByVal fileName$)
  13. Declare Function FileFindPath$ Lib "VBIT.DLL" (ByVal fileName$)
  14. Declare Function FileGetAttr$ Lib "VBIT.DLL" (ByVal fileName$)
  15. Declare Function FileGetDate$ Lib "VBIT.DLL" (ByVal fileName$)
  16. Declare Function FileGetExt$ Lib "VBIT.DLL" (ByVal fileName$)
  17. Declare Function FileGetFileName$ Lib "VBIT.DLL" (ByVal fileName$)
  18. Declare Function FileGetName$ Lib "VBIT.DLL" (ByVal fileName$)
  19. Declare Function FileGetPath$ Lib "VBIT.DLL" (ByVal fileName$)
  20. Declare Function FileGetSize& Lib "VBIT.DLL" (ByVal fileName$)
  21. Declare Function FileGetTime$ Lib "VBIT.DLL" (ByVal fileName$)
  22. Declare Function FileGetVersion$ Lib "VBIT.DLL" (ByVal fileName$)
  23. Declare Function Find% Lib "VBIT.DLL" (ByVal findString$, ByVal inString$, ByVal pos%)
  24. Declare Function FullPath$ Lib "VBIT.DLL" (ByVal filePattern$)
  25. Declare Function GetAppName$ Lib "VBIT.DLL" ()
  26. Declare Function GetWinClassName$ Lib "VBIT.DLL" (ByVal hwnd%)
  27. Declare Function GetDayNumber& Lib "VBIT.DLL" (ByVal dateStr$, ByVal dateFmt$)
  28. Declare Function GetDateLong& Lib "VBIT.DLL" (ByVal dateNum&)
  29. Declare Function GetDateStr$ Lib "VBIT.DLL" (ByVal dateNum&, ByVal dateFmt$)
  30. Declare Function GetNumDays& Lib "VBIT.DLL" (ByVal fromDate$, ByVal toDate$, ByVal dateFmt$, ByVal typ%)
  31. Declare Function IniFileGetString$ Lib "VBIT.DLL" (ByVal fileName$, ByVal section$, ByVal entry$)
  32. Declare Function IniFilePutString% Lib "VBIT.DLL" (ByVal fileName$, ByVal section$, ByVal entry$, ByVal newString$)
  33. Declare Function Interest# Lib "VBIT.DLL" (ByVal fromDate$, ByVal toDate$, ByVal dateFmt$, amount#, iRate#, ByVal typ%)
  34. Declare Function LicenseGetCode$ Lib "VBIT.DLL" (ByVal lname$, ByVal lcode$)
  35. Declare Function LicenseVBIT% Lib "VBIT.DLL" (ByVal lname$, ByVal lcode$)
  36. Declare Function LicenseProgram% Lib "VBIT.DLL" (ByVal lname$, ByVal lcode$, ByVal key$)
  37. Declare Function Modulus10$ Lib "VBIT.DLL" (ByVal strIn$)
  38. Declare Function Modulus10Calc$ Lib "VBIT.DLL" (ByVal strIn$)
  39. Declare Function Modulus10Valid% Lib "VBIT.DLL" (ByVal strIn$)
  40. Declare Function Modulus11$ Lib "VBIT.DLL" (ByVal strIn$)
  41. Declare Function Modulus11Calc$ Lib "VBIT.DLL" (ByVal strIn$)
  42. Declare Function Modulus11Valid% Lib "VBIT.DLL" (ByVal strIn$)
  43. Declare Function Num0$ Lib "VBIT.DLL" (ByVal value&, ByVal nDigits%)
  44. Declare Function pick$ Lib "VBIT.DLL" (ByVal strIn$, ByVal pos%, ByVal num%)
  45. Declare Function pickWord$ Lib "VBIT.DLL" (ByVal strIn$, ByVal pos%, ByVal delim%)
  46. Declare Function PickWords$ Lib "VBIT.DLL" (ByVal strIn$, ByVal pos%, ByVal num%, ByVal delim%)
  47. Declare Function place$ Lib "VBIT.DLL" (ByVal fromStr$, ByVal toStr$, ByVal pos%, ByVal num%)
  48. Declare Function strip$ Lib "VBIT.DLL" (ByVal strIn$, ByVal delim$, ByVal stripType%)
  49. Declare Function Subst$ Lib "VBIT.DLL" (ByVal oldStr$, ByVal newStr$, ByVal inString$, pos%)
  50. Declare Function substAll$ Lib "VBIT.DLL" (ByVal oldStr$, ByVal newStr$, ByVal inString$)
  51. Declare Function SwapChrs$ Lib "VBIT.DLL" (ByVal strIn$, ByVal chrs$)
  52. Declare Function SwapDate$ Lib "VBIT.DLL" (ByVal dateIn$)
  53. Declare Function SwapStr$ Lib "VBIT.DLL" (ByVal strIn$, ByVal fromFmt$, ByVal toFmt$)
  54. Declare Function SysInfo$ Lib "VBIT.DLL" (ByVal what%)
  55. Declare Function SysInfoNum& Lib "VBIT.DLL" (ByVal what%)
  56. Declare Sub Trace Lib "VBIT.DLL" (ByVal strIn$)
  57. Declare Sub TraceStr Lib "VBIT.DLL" (ByVal strIn$)
  58. Declare Sub Sound Lib "VBIT.DLL" (ByVal typ$)
  59. Declare Function FormNum$ Lib "VBIT.DLL" (ByVal numb#, ByVal nDec%, ByVal length%, ByVal fmt$)
  60.  
  61. ' Types for Strip (Leading/Trailing or Left/Right):
  62. Global Const STRIP_L% = &H100
  63. Global Const STRIP_T% = &H200
  64. Global Const STRIP_R% = &H200
  65. Global Const STRIP_LT% = &H300
  66. Global Const STRIP_LR% = &H300
  67. Global Const STRIP_ALL% = &H400
  68.  
  69. ' Types for SysInfo:
  70. Global Const SCREEN_SIZE_X% = 1
  71. Global Const SCREEN_SIZE_Y% = 2
  72. Global Const SCREEN_SIZE_PALETTE% = 3
  73. Global Const MEMORY_FREE_KB% = 4
  74. Global Const MEMORY_BIGGEST_FREE_BLOCK_KB% = 5
  75. Global Const DISK_DRIVE% = 6
  76. Global Const DIR_WINDOWS% = 7
  77. Global Const DIR_WINDOWS_SYSTEM% = 8
  78. Global Const DISK_FREE_KB% = &H80
  79. Global Const DISK_SIZE_KB% = &H100
  80. Global Const DISK_CLUSTER_SIZE = &H180
  81. Global Const DISK_SECTOR_SIZE = &H200
  82. Global Const DISK_SECTORS_PR_CLUSTER = &H280
  83. Global Const DISK_AVAILABLE_CLUSTERS = &H300
  84. Global Const DISK_TOTAL_CLUSTERS = &H380
  85.  
  86. Global Const DISK_PATH% = &H1000
  87. Global Const DISK_TYPE% = &H1080
  88. Global Const DISK_VOLUME_SERIAL_NUMBER% = &H1100
  89. Global Const DISK_VOLUME_LABEL% = &H1180
  90. Global Const DISK_VOLUME_DATE% = &H1200
  91. Global Const DISK_VOLUME_TIME% = &H1280
  92.  
  93. ' SysInfo(DISK_TYPE) returns:
  94. Global Const DRIVE_REMOVABLE% = 2
  95. Global Const DRIVE_FIXED% = 3
  96. Global Const DRIVE_REMOTE% = 4
  97. Global Const DRIVE_CDROM% = 5
  98.  
  99. 'Constants for GetNumDays and Interest..
  100. Global Const IT_MONTH% = 0
  101. Global Const IT_MONTH_30% = 1
  102. Global Const IT_YEAR% = 0
  103. Global Const IT_YEAR_360% = 2
  104. Global Const IT_YEAR_365% = 4
  105. Global Const IT_DATE_NO_VB_RT_ERR% = &H4000
  106.  
  107. Function VBIT_init (ByVal progName$, ByVal licenseName$, ByVal licenseCode$, ByVal minVer#, ByVal lang%) As Integer
  108.     Dim s$, c$, f$
  109.     Dim ok%
  110.     f$ = "VBIT.DLL"
  111.     On Error Resume Next
  112.     ok% = LicenseVBIT(licenseName$, licenseCode$)
  113.     If Err = 0 Then
  114.        If Not ok% Then
  115.           Sound "!"
  116.           Select Case lang%
  117.           Case 47
  118.              s$ = "Feil lisenskode for " & licenseName$
  119.           Case Else
  120.              s$ = "Wrong license code for " & licenseName$
  121.           End Select
  122.           MsgBox s$, 64, FileFindPath(f$)
  123.        End If
  124.        VBIT_init = True   ' VBIT.DLL was found
  125.        s$ = FileGetVersion(f$)
  126.        If Val(s$) < minVer# Then
  127.           Sound ("!")
  128.           Select Case lang%
  129.           Case 47
  130.               s$ = "Filen """ & f$ & """ er for gammel !|(versjon=" & s$
  131.               s$ = s$ & ": skulle ha vµrt minst " & minVer#
  132.               s$ = s$ & ")||Hvis du ikke finner σrsaken|(f.eks. feil oppsett / sti),|"
  133.               s$ = s$ & "b°r du installere " & progName & " pσ nytt."
  134.               c$ = "FEIL VERSJON"
  135.           Case Else
  136.               s$ = "The file """ & f$ & """ is too old !|(version=" & s$
  137.               s$ = s$ & ": should have been at least " & minVer#
  138.               s$ = s$ & ")||If you can't find the reason (e.g. wrong path),|"
  139.               s$ = s$ & "you must reinstall " & progName & "."
  140.               c$ = "VERSION ERROR"
  141.           End Select
  142.           MsgBox CRLF(s$, -Asc("|")), 16, c$
  143.           VBIT_init = False   ' VBIT.DLL was found, but is too old
  144.        End If
  145.     Else
  146.        Beep
  147.        Select Case lang%
  148.        Case 47
  149.             s$ = "Finner ikke filen """ & f$ & """ !" & Chr$(13) & Chr$(10)
  150.             s$ = s$ & "InstallΘr " & progName & " pσ nytt."
  151.             c$ = "PROGRAMFEIL"
  152.        Case Else
  153.             s$ = "Can not find """ & f$ & """ !" & Chr$(13) & Chr$(10)
  154.             s$ = s$ & "You must reinstall " & progName & "."
  155.             c$ = "ERROR"
  156.        End Select
  157.        MsgBox s$, 16, c$
  158.        VBIT_init = False  ' VBIT.DLL was not found
  159.     End If
  160. End Function
  161.  
  162.